package com.itheima.stock.algorithm;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;

import java.util.Collection;
import java.util.Date;

/**
 * @author by itheima
 * @Date 2022/1/5
 * @Description 定义数据库分片策略（必须）
 */
@Slf4j
public class PreciseTableShardingAlgorithm4MarketInfos implements PreciseShardingAlgorithm<Date> {
    @Override
    public String doSharding(Collection<String> collection, PreciseShardingValue<Date> preciseShardingValue) {
        return "stock_market_index_info";
    }
}
